<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">


<!--显示分页信息-->

<div th:fragment="pages_split" class="modal-footer no-margin-top">
    <!--        上一页-->
    <!--        如果为第一页，则没有a标签-->
    <th:block th:if="${pageInfo.pageNum==1}">
        <p style="margin-top: 15px">上一页</p>
    </th:block>
    <th:block th:if="${pageInfo.pageNum>1}">
        <a th:href="@{${#httpServletRequest.getRequestURL()}(pageNum=${pageInfo.pageNum-1})}">
            <p style="margin-top: 15px">上一页</p>
        </a>
    </th:block>
    <!--        页码遍历-->
    <th:block th:each="i :${#numbers.sequence(1, pageInfo.pages)}">
        <a th:href="@{${#httpServletRequest.getRequestURL()}(pageNum=${i})}">
            <!--                当前页样式为on-->
            <span th:class="${pageInfo.pageNum == i}? 'on' :''">
                <th:block th:text="${i}"></th:block>
            </span>
        </a>
    </th:block>
    <!--下一页-->
    <!--        如果为最后一页也没有a标签-->
    <th:block th:if="${pageInfo.pageNum==pageInfo.pages}">
        <p style="margin-top: 15px">下一页</p>
    </th:block>
    <th:block th:if="${pageInfo.pageNum<pageInfo.pages}">
        <a th:href="@{${#httpServletRequest.getRequestURL()}(pageNum=${pageInfo.pageNum+1})}">
            <p style="margin-top: 15px">下一页</p>
        </a>
    </th:block>
</div>


</html>